import React, {Component} from 'react';
import {Carousel, Card} from 'antd'
import {GlobalOutlined} from '@ant-design/icons'
import Carousel1 from '../../assets/carousel1.jpg'
import Carousel2 from '../../assets/carousel2.jpg'
import Carousel3 from '../../assets/carousel3.jpg'
import Carousel4 from '../../assets/carousel4.jpg'
import {Link} from 'react-router-dom';
import ListItem from '../../components/ListItem/listItem'
import './style.less';
import Footer from "../../components/footer";

const listData = [
    {
        id:'5ffd3d3f4f749a16cf403d5e',
        title:'电建公司对东都设计院开展年底责任制检查',
        date:'2021-01-07'
    },
    {
        id:'5fe011054f749a16cf403d5d',
        title:'"杭州市“五最楼道”武林路435号加装电梯顺利交付',
        date:'2020-12-18'
    },
    {
        id:'5fbdb88b4f749a16cf403d5c',
        title:'东都设计院在职党支部开展2020年红色教育活动',
        date:'2020-11-23'
    }, {
        id:'5fadfc524f749a16cf403d5b',
        title:'东都设计院成功中标落架大修EPC总承包项目',
        date:'2020-11-13'
    }, {
        id:'5fadfb2c4f749a16cf403d5a',
        title:'东都院既有住宅流水西苑加装电梯开工',
        date:'2020-10-19'
    },
    {
        id:'5f3f27287b9eb75776cf7eb9',
        title: '东都设计院顺利交付曙光家园第四台加装电梯',
        date:'2020-09-28'
    },
    {
        id:'5f4dedc27b9eb75776cf7eba',
        title: '东都设计院举办既有住宅加装电梯现场咨询活动',
        date:'2020-08-20'
    }
]


const Home = () => {

    return (
        <>
            <div className='home-container'>
                <Carousel>
                    <div className='home-carousel'>
                        <img src={Carousel1} alt='img'/>
                    </div>
                    <div className='home-carousel'>
                        <img src={Carousel2} alt='img'/>
                    </div>
                    <div className='home-carousel'>
                        <img src={Carousel3} alt='img'/>
                    </div>
                    <div className='home-carousel'>
                        <img src={Carousel4} alt='img'/>
                    </div>
                </Carousel>
                <div className='home-news'>
                    <Card
                        title={(<h1 style={{color: '#1e90ff', fontSize: '18px', margin: 0}}><GlobalOutlined
                            style={{color: '#1e90ff', fontSize: '19px', marginRight: '5px'}}/>新闻中心</h1>)}
                    >
                        {listData.map((item)=>(
                            <ListItem key={item.id} date={item.date} title={item.title} />
                        ))}
                        <Link to='/news'>
                            <ShowMore />
                        </Link>
                    </Card>
                </div>
            </div>
            <Footer/>
        </>

    )
}

const ShowMore = () => {
    return (
        <div className='show-more'>
            查看更多 > >
        </div>
    )
}

export default Home;
